<template>
	<div style="background-color: #000;min-height: 100vh;color: #fff;">
		<div style="position: relative;height:4em;overflow: hidden;">
			<div style="position:absolute;top: 0;left: 0;right: 0;height: 7em;background-color: #fff;opacity: 0.5;">
			</div>
			<div style="position: absolute;left: 1.0em;top: 0px;">
				<image :src="imgHttp + '/test/bg/logo.png'" style="height: 4em;width: 7em;"></image>
			</div>
		</div>
		<div @click="toIndex" style="display: flex;justify-items: center;margin: 0.5em;">
			<div>
				<image :src="imgHttp + '/test/back.png'" style="width: 1.5em;height:1.5em;"></image>
			</div>
			<div style="font-size: 1em;">返回首页</div>
		</div>
		<div style="text-align: center;">
			<image :src="http + obj.prDetail" style="width: 90%;height: 10em;"></image>
		</div>
		<div style="width: 90%;margin: 0 auto;">
			<div style="font-size: 1.5em;margin-top: 0.5em;margin-bottom: 0.7em;">{{obj.prModel}}</div>
			<table>
				<tr>
					<td>系列</td>
					<td>{{obj.remark}}</td>
				</tr>
				<tr>
					<td>型号</td>
					<td>{{obj.prModel}}</td>
				</tr>
				<tr>
					<td>厚度</td>
					<td>{{obj.prProperty}}</td>
				</tr>
				<tr>
					<td>材质</td>
					<td>{{obj.prTexture}}</td>
				</tr>
				<tr>
					<td>质保年限</td>
					<td>{{obj.prDeadline}}</td>
				</tr>
				<tr>
					<td>价格￥</td>
					<td>{{obj.prPrice}}</td>
				</tr>
				<tr>
					<td>销量</td>
					<td>{{obj.prQuantity}}</td>
				</tr>
			</table>
			<div style="margin-top: 0.5em;">&nbsp;</div>
		</div>
	</div>
</template>

<script>
	import api from '@/common/httprequest.js'
	export default {
		data() {
			return {
				imgHttp: api.getImgUrl(),
				http: api.getUrl(),
				obj: {}
			}
		},
		onLoad(options) {
			var jsonStr = decodeURIComponent(options.data);
			this.obj = JSON.parse(jsonStr);
			//alert(JSON.stringify(this.obj))
		},
		mounted() {

		},
		methods: {
			toIndex() {
				uni.switchTab({
					url: '../index/index'
				})
			},
			addData() {
				if (this.obj.leNumber == null) {
					uni.showToast({
						icon: 'error',
						duration: 1000,
						title: '手机号不能为空！'
					})
					return;
				}
				uni.showLoading({
					title: '数据处理中...'
				});
				api.request({
					method: "post",
					url: "/applet/league",
					params: this.obj,
				}).then(res => {
					uni.hideLoading();
					//alert(JSON.stringify(res));

					if (res.code == 200) {
						uni.showToast({
							title: '加盟店申请成功！',
							icon: 'none',
							duration: 2000
						})
						uni.redirectTo({
							url: '/pages/jmd/index'
						})
						return;
					}
				});
			}
		}
	}
</script>

<style>
	table {
		border-collapse: collapse;
		width: 100%;
	}

	th,
	td {
		border: 1px solid #ccc;
		padding: 8px;
		text-align: left;
	}

	.clear {
		clear: both;
	}
</style>